using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NCS.Library.Utilities;
using NCS.Module.CMS.Library;
using NCS.Library;
using NCS.Module.CMS.Library.Comments;
using NCS.Module.CMS.Library.Distributions;
namespace NCS.Module.CMS.Web.Financial
{
    public partial class RightFeedBack : CMSWebControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int catid = ConvertUtility.ToInt32(Request.QueryString["catid"]);
            if (catid != 0)
            {
                Advertisement1.Param = "catid";
            }
            
            rptNewsMostViews.DataSource = CommentDB.TopComments(5);
            rptNewsMostViews.DataBind();

        }
        protected void rptNewsMostViews_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView currow = (DataRowView)e.Item.DataItem;
                HyperLink hplTitle = (HyperLink)e.Item.FindControl("hplTitle");

                hplTitle.Text = ConvertUtility.ToString(currow["Content_Headline"]);

                string tooltip = MiscUtility.ToolTip(ConvertUtility.ToString(currow["Content_Headline"]), ConvertUtility.ToString(currow["Content_SubTitle"]), ConvertUtility.ToString(currow["Content_Avatar"]), ConvertUtility.ToString(currow["Content_Teaser"]), ConvertUtility.ToString(currow["Content_Alias"]), ConvertUtility.ToDateTime(currow["Distribution_CreateDate"]));
                hplTitle.Attributes.Add("onmouseover", "showtip('" + tooltip + "','322','#fcf9ea')");
                hplTitle.Attributes.Add("onmouseout", "hidetip()");

                hplTitle.NavigateUrl = BuildUrlByDistId(DistributionController.GetDistID((int)currow["Distribution_ContentID"]), (int)currow["Distribution_ZoneID"]);
            }
        }
    }
}